﻿using System.ComponentModel.DataAnnotations;
using Devonline.Entity;
using Devonline.Identity;
using Microsoft.EntityFrameworkCore;

namespace ProjectManagement.Models
{
    [Display(Name = "数据库上下文")]
    public partial class ApplicationDbContext : DbContext
    {
        /// <summary>
        /// http上下文
        /// </summary>
        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
            : base(options)
        {
            //全局禁用实体自动跟踪
            ChangeTracker.AutoDetectChangesEnabled = false;
        }

        #region base entity model
        public virtual DbSet<Attachment> Attachments { get; set; }
        public virtual DbSet<Parameter> Parameters { get; set; }
        //public virtual DbSet<AccessRule> AccessRules { get; set; }
        //public virtual DbSet<Group> Groups { get; set; }
        //public virtual DbSet<Resource> Resources { get; set; }
        //public virtual DbSet<Role> Roles { get; set; }
        public virtual DbSet<User> Users { get; set; }
        #endregion

        #region business Models
        public virtual DbSet<Item> Items { get; set; }
        public virtual DbSet<Issue> Issues { get; set; }
        public virtual DbSet<ItemAdditional> ItemAdditionals { get; set; }
        public virtual DbSet<IssueAdditional> IssueAdditionals { get; set; }
        #endregion
    }
}
